load('../src/ph/ph.js');

ph.bootstrap(arguments[0]);

var _in  = new java.io.BufferedReader(new java.io.InputStreamReader(java.lang.System['in']));
var _out = new java.io.BufferedWriter(new java.io.OutputStreamWriter(java.lang.System['out']));

function ready() {
  _out.write('>');
  _out.write(' ');
  _out.flush();
}

var s;
do {
  ready();
  s = _in.readLine();
  
  if (s == null)
    break;
  
  try {
    print(eval(ph.str(s)));
  } catch(e) {
    print(e.toString());
  }
} while (true);